From: Noah Friedman Date: Tue, 30 Mar 1993 22:21:03 +0000 (+0000) Subject: (find-backup-file-name): delete nothing if overflow in number of files to keep. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~96629 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=9115e9389c75ae7f0da5743421aebb3977016e6d;p=emacs.git (find-backup-file-name): delete nothing if overflow in number of files to keep. --- diff --git a/lisp/files.el b/lisp/files.el index b8cb0a0ea5c..fe3a29cfdd1 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1141,7 +1141,10 @@ Value is a list whose car is the name for the backup file (if (not deserve-versions-p) (list (make-backup-file-name fn)) (cons (concat fn ".~" (int-to-string (1+ high-water-mark)) "~") - (if (> number-to-delete 0) + (if (and (> number-to-delete 0) + ;; Delete nothing if there is overflow + ;; in the number of versions to keep. + (>= (+ kept-new-versions kept-old-versions -1) 0)) (mapcar (function (lambda (n) (concat fn ".~" (int-to-string n) "~"))) (let ((v (nthcdr kept-old-versions versions)))